package com.hzj.controller;

import com.hzj.pojo.vo.user.UserInfoQueryVo;
import com.hzj.service.AdminService;
import com.hzj.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Aisling
 * @date 2021-05-12 15:07
 */

@RestController
@RequestMapping("/consumer/admin/user")
@CrossOrigin
public class AdminController {

    @Autowired
    AdminService as;


    @PostMapping("/list/{page}/{limit}")
    public Result findAll(@PathVariable Integer page, @PathVariable Integer limit, @RequestBody UserInfoQueryVo queryVo){
        return as.findAll(page, limit, queryVo);
    }

    @PostMapping("/lock/{id}/{status}")
    public Result lockUser(@PathVariable Integer id,@PathVariable Integer status){
        return as.lockUser(id,status);
    }

    @PostMapping("/show/By/{id}")
    public Result userDetails(@PathVariable Integer id){
        return as.userDetails(id);
    }

    @PostMapping("/approval/{id}/{authStatus}")
    public Result userApproval(@PathVariable Integer id, @PathVariable Integer authStatus){
        return as.userApproval(id,authStatus);
    }

    @PostMapping("/delectUserinfo/{id}")
    public Result deleteUserinfo(@PathVariable Integer id){
        return as.deleteUserInfo(id);
    }
}
